package com.linkallcloud.core.enums;

public enum YesNo implements EnumBase<Integer> {
    YES(1, "YES"), NO(0, "NO");

    private int code;
    private String message;

    YesNo(int code, String message) {
        this.code = code;
        this.message = message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getMessage() {
        return message;
    }

    public static YesNo get(Integer code) {
        for (YesNo ul : values()) {
            if (ul.getCode().equals(code)) {
                return ul;
            }
        }
        return null;
    }
}
